import service from "@/util/request.js";

// 获取banner
export function listBanner(data = {}) {
	return service.request({
		url: '/banner',
		method: 'GET',
		params: data,
	})
}

// 获取推荐歌曲
export function listRecommendSongs(data = {}) {
	return service.request({
		url: '/personalized',
		method: 'GET',
		params: data,
	})
}

// 获取新碟
export function listNewesTalbum(data = {}) {
	return service.request({
		url: '/album/newest',
		method: 'GET',
		params: data,
	})
}

// 获取热门搜索
export function listHotSearch() {
	return service.request({
		url: '/search/hot/detail',
		method: 'GET',
		params: {},
	})
}

// 获取关键字
export function listSearchSuggest(keywords) {
	return service.request({
		url: '/search/suggest?type=mobile',
		method: 'GET',
		params: {keywords: keywords},
	})
}

// 获取歌曲
export function searchSong(data = {}) {
	return service.request({
		url: '/search?type=1',
		method: 'GET',
		params: data,
	})
}

// 获取歌单详情
export function getPlaylistDetail(id) {
	return service.request({
		url: '/playlist/detail',
		method: 'GET',
		params: {id: id},
	})
}

// 获取歌曲URL
export function getSongUrl(id) {
	return service.request({
		url: '/song/url',
		method: 'GET',
		params: {id: id},
	})
}

// 获取歌曲详情
export function getSongDetail(id) {
	return service.request({
		url: '/song/detail',
		method: 'GET',
		params: {ids: id},
	})
}